package com.zc.im.mapper.im.group;

import com.zc.im.model.im.group.ZcImGroupAudit;
import com.zc.im.model.im.group.ZcImGroupAuditExample;
import com.zc.im.model.im.group.ZcImGroupAuditKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

public interface ZcImGroupAuditMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_audit
     *
     * @mbggenerated
     */
    int countByExample(ZcImGroupAuditExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_audit
     *
     * @mbggenerated
     */
    int deleteByExample(ZcImGroupAuditExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_audit
     *
     * @mbggenerated
     */
    @Delete({
        "delete from zc_im_group_audit",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(ZcImGroupAuditKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_audit
     *
     * @mbggenerated
     */
    @Insert({
        "insert into zc_im_group_audit (id, type, ",
        "group_name, company_id, ",
        "created_time, updated_time, ",
        "created_user_id, audit_user_id, ",
        "audit_content, audit_status, ",
        "status)",
        "values (#{id,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}, ",
        "#{groupName,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, ",
        "#{createdTime,jdbcType=TIMESTAMP}, #{updatedTime,jdbcType=TIMESTAMP}, ",
        "#{createdUserId,jdbcType=INTEGER}, #{auditUserId,jdbcType=INTEGER}, ",
        "#{auditContent,jdbcType=VARCHAR}, #{auditStatus,jdbcType=VARCHAR}, ",
        "#{status,jdbcType=VARCHAR})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=true, resultType=Integer.class)
    int insert(ZcImGroupAudit record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_audit
     *
     * @mbggenerated
     */
    int insertSelective(ZcImGroupAudit record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_audit
     *
     * @mbggenerated
     */
    List<ZcImGroupAudit> selectByExample(ZcImGroupAuditExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_audit
     *
     * @mbggenerated
     */
    @Select({
        "select",
        "id, type, group_name, company_id, created_time, updated_time, created_user_id, ",
        "audit_user_id, audit_content, audit_status, status",
        "from zc_im_group_audit",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    ZcImGroupAudit selectByPrimaryKey(ZcImGroupAuditKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_audit
     *
     * @mbggenerated
     */
    int updateByExampleSelective(@Param("record") ZcImGroupAudit record, @Param("example") ZcImGroupAuditExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_audit
     *
     * @mbggenerated
     */
    int updateByExample(@Param("record") ZcImGroupAudit record, @Param("example") ZcImGroupAuditExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_audit
     *
     * @mbggenerated
     */
    int updateByPrimaryKeySelective(ZcImGroupAudit record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_im_group_audit
     *
     * @mbggenerated
     */
    @Update({
        "update zc_im_group_audit",
        "set type = #{type,jdbcType=VARCHAR},",
          "group_name = #{groupName,jdbcType=VARCHAR},",
          "company_id = #{companyId,jdbcType=INTEGER},",
          "created_time = #{createdTime,jdbcType=TIMESTAMP},",
          "updated_time = #{updatedTime,jdbcType=TIMESTAMP},",
          "created_user_id = #{createdUserId,jdbcType=INTEGER},",
          "audit_user_id = #{auditUserId,jdbcType=INTEGER},",
          "audit_content = #{auditContent,jdbcType=VARCHAR},",
          "audit_status = #{auditStatus,jdbcType=VARCHAR},",
          "status = #{status,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ZcImGroupAudit record);
}